<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>
<%@page import="com.ckeditor.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <jsp:include flush="true" page="_header.jsp"></jsp:include>
  <body class="bgwhite">
  	<div class="pannel">
  		<form name="frmcreatearticle" id="frmcreatearticle" method="post" action="admin.do?action=article&operate=create">
  		<fieldset>
	  		<legend>发布文章</legend>
	  		<p>
	  			<label for="title">标题：</label>
	  		</p>
	  		<p>
	  			<input name="title" size="70" class="txt" type="text" value="" />
	  			<input name="author" type="hidden" value="管理员" />
	  		</p>
	  		<logic:empty name="typeid">
	  			<logic:empty name="childNodes">
	  				<input name="fatherid" type="hidden" value="<bean:write name="fatherid" />" />
	  				<input name="typeid" type="hidden" value="<bean:write name="fatherid" />" />
	  			</logic:empty>
	  			<logic:notEmpty name="childNodes">
		  			<p>
			  			<label for="content">文章分类：</label>
			  		</p>
			  		<p>
		  				<select name="typeid">
			  				<logic:iterate id="childNodes" name="childNodes">
			  					<option value="<bean:write name="childNodes" property="id" />"><bean:write name="childNodes" property="typename" /></option>
			  				</logic:iterate>
			  			</select>
		  			</p>
		  			<input name="fatherid" type="hidden" value="<bean:write name="fatherid" />" />
		  		</logic:notEmpty>
	  		</logic:empty>
	  		<logic:notEmpty name="typeid">
	  			<input name="typeid" type="hidden" value="<bean:write name="typeid" />" />
	  			<input name="fatherid" type="hidden" value="<bean:write name="fatherid" />" />
	  		</logic:notEmpty>
	  		<logic:equal value="17" name="fatherid">
	  			<p>
		  			<label for="title">作者：</label>
		  		</p>
		  		<p>
		  			<input name="articleauthor2" id="articleauthor2" maxlength="28" size="50" class="txt" type="text" value="" />
		  		</p>
	  		</logic:equal>
	  		<p>
	  			<label for="content">文章内容：</label>
	  		</p>
	  		<p>
	  			<textarea cols="80" id="content" name="content" rows="10"></textarea>
	  			<% 
			        CKEditorConfig settings = new CKEditorConfig();
			        settings.addConfigValue("toolbar","[['Source','-','Bold','Italic','Strike','-','RemoveFormat' ],['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],[ 'TextColor','BGColor' ], [ 'Find','Replace','-','SelectAll','-','Scayt' ],[ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote' ], [ 'Link','Unlink','Anchor' ], [ 'Image','HorizontalRule','PageBreak' ]]");
			        settings.addConfigValue("width", "90%");
			        settings.addConfigValue("height", "270px");
			        settings.addConfigValue("filebrowserUploadUrl","ckUpload.do?type=File");
					settings.addConfigValue("filebrowserImageUploadUrl","ckUpload.do?type=Image");
 				%>
				<ckeditor:replace replace="content" basePath="./ckeditor/" config="<%=settings %>" />
	  		</p>
	  		<p>
	  			<input class="btn-submit" type="submit" value="确定" />
	  		</p>
	  	</fieldset>
	  	</form>
  	</div>
  </body>
</html>